<template>
	<view>
		<rich-text :nodes="content"></rich-text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				slug: '',
				content: ''
			};
		},
		onLoad(e) {
			// if (e.title) {
			// 	this.title = e.title
			// 	uni.setNavigationBarTitle({
			// 		title: e.title
			// 	})
			// }
			if (e.slug) {
				this.slug = e.slug
				this.getArtical()
			}
		},
		methods: {
			getArtical() {
				uni.showLoading({
					title: '数据获取中...'
				})
				this.$api.requst('/gwc/user/wiki/' + this.slug, {
					slug: this.slug
				}).then(res => {
					this.content = this.$api.formatRichText(res.data.body)
					uni.setNavigationBarTitle({
						title: res.data.title
					})

				})
			}
		}
	}
</script>

<style lang="scss" scoped>


</style>